Start laying some half-hearted groundwork for rte_name to be a QString.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 3 Jun 2013 03:54:56 +0000 (03:54 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 3 Jun 2013 03:54:56 +0000 (03:54 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4389 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/GPSBabel.xcodeproj/project.pbxproj
gpsbabel/GPSBabel.xcodeproj/project.xcworkspace/xcuserdata/robertlipe.xcuserdatad/UserInterfaceState.xcuserstate
gpsbabel/csv_util.cc
gpsbabel/gtm.cc
gpsbabel/mapsend.cc
gpsbabel/psitrex.cc

index 6011601eba9839a0ccae3701b06d0d4e81859ef2..3d63ac10cdecf99601d168a79aa47a9034f17a92 100644 (file)
                EC364AB3175C11AF00D370A8 /* GPSBabel */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = GPSBabel; sourceTree = BUILT_PRODUCTS_DIR; };
                EC364AB5175C11EE00D370A8 /* bend.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bend.cc; sourceTree = SOURCE_ROOT; };
                ECCFD60E175C195300558D26 /* gpsutil.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gpsutil.cc; path = "/Users/robertlipe/src/gpsbabel-reallyvirgin/jeeps/gpsutil.cc"; sourceTree = "<absolute>"; };
+               ECE352B9175C42AB00FC07CB /* an1sym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = an1sym.h; sourceTree = SOURCE_ROOT; };
+               ECE352BA175C42AB00FC07CB /* avltree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = avltree.h; sourceTree = SOURCE_ROOT; };
+               ECE352BB175C42AB00FC07CB /* cet_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cet_util.h; sourceTree = SOURCE_ROOT; };
+               ECE352BC175C42AB00FC07CB /* cet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cet.h; sourceTree = SOURCE_ROOT; };
+               ECE352BD175C42AB00FC07CB /* csv_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = csv_util.h; sourceTree = SOURCE_ROOT; };
+               ECE352BE175C42AB00FC07CB /* defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = defs.h; sourceTree = SOURCE_ROOT; };
+               ECE352BF175C42AB00FC07CB /* explorist_ini.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = explorist_ini.h; sourceTree = SOURCE_ROOT; };
+               ECE352C0175C42AB00FC07CB /* filterdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filterdefs.h; sourceTree = SOURCE_ROOT; };
+               ECE352C1175C42AB00FC07CB /* garmin_device_xml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = garmin_device_xml.h; sourceTree = SOURCE_ROOT; };
+               ECE352C2175C42AB00FC07CB /* garmin_fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = garmin_fs.h; sourceTree = SOURCE_ROOT; };
+               ECE352C3175C42AB00FC07CB /* garmin_gpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = garmin_gpi.h; sourceTree = SOURCE_ROOT; };
+               ECE352C4175C42AB00FC07CB /* garmin_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = garmin_tables.h; sourceTree = SOURCE_ROOT; };
+               ECE352C5175C42AB00FC07CB /* gbdatetime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gbdatetime.h; sourceTree = SOURCE_ROOT; };
+               ECE352C6175C42AB00FC07CB /* gbfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gbfile.h; sourceTree = SOURCE_ROOT; };
+               ECE352C7175C42AB00FC07CB /* gbser_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gbser_private.h; sourceTree = SOURCE_ROOT; };
+               ECE352C8175C42AB00FC07CB /* gbser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gbser.h; sourceTree = SOURCE_ROOT; };
+               ECE352C9175C42AB00FC07CB /* gbtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gbtypes.h; sourceTree = SOURCE_ROOT; };
+               ECE352CA175C42AB00FC07CB /* grtcirc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = grtcirc.h; sourceTree = SOURCE_ROOT; };
+               ECE352CB175C42AB00FC07CB /* height.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = height.h; sourceTree = SOURCE_ROOT; };
+               ECE352CC175C42AB00FC07CB /* holux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = holux.h; sourceTree = SOURCE_ROOT; };
+               ECE352CD175C42AB00FC07CB /* inifile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inifile.h; sourceTree = SOURCE_ROOT; };
+               ECE352CE175C42AB00FC07CB /* magellan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = magellan.h; sourceTree = SOURCE_ROOT; };
+               ECE352CF175C42AB00FC07CB /* mapsend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mapsend.h; sourceTree = SOURCE_ROOT; };
+               ECE352D0175C42AB00FC07CB /* navilink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = navilink.h; sourceTree = SOURCE_ROOT; };
+               ECE352D1175C42AB00FC07CB /* pdbfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pdbfile.h; sourceTree = SOURCE_ROOT; };
+               ECE352D2175C42AB00FC07CB /* queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = queue.h; sourceTree = SOURCE_ROOT; };
+               ECE352D3175C42AB00FC07CB /* quovadis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quovadis.h; sourceTree = SOURCE_ROOT; };
+               ECE352D4175C42AB00FC07CB /* session.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = session.h; sourceTree = SOURCE_ROOT; };
+               ECE352D5175C42AB00FC07CB /* strptime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strptime.h; sourceTree = SOURCE_ROOT; };
+               ECE352D6175C42AB00FC07CB /* uuid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uuid.h; sourceTree = SOURCE_ROOT; };
+               ECE352D7175C42AB00FC07CB /* xmlgeneric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xmlgeneric.h; sourceTree = SOURCE_ROOT; };
                F23634C8B2CD5F154B8A03F1 /* queue.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = queue.cc; sourceTree = SOURCE_ROOT; };
                F50B0A339AAF046C1C09533A /* darwin.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = darwin.c; path = mac/libusb/darwin.c; sourceTree = SOURCE_ROOT; };
                F5234B294500E1AAFDC9A3FD /* gnav_trl.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = gnav_trl.cc; sourceTree = SOURCE_ROOT; };
                05596AB53D8D521C69802C27 /* GPSBabel */ = {
                        isa = PBXGroup;
                        children = (
+                               ECE352B9175C42AB00FC07CB /* an1sym.h */,
+                               ECE352BA175C42AB00FC07CB /* avltree.h */,
+                               ECE352BB175C42AB00FC07CB /* cet_util.h */,
+                               ECE352BC175C42AB00FC07CB /* cet.h */,
+                               ECE352BD175C42AB00FC07CB /* csv_util.h */,
+                               ECE352BE175C42AB00FC07CB /* defs.h */,
+                               ECE352BF175C42AB00FC07CB /* explorist_ini.h */,
+                               ECE352C0175C42AB00FC07CB /* filterdefs.h */,
+                               ECE352C1175C42AB00FC07CB /* garmin_device_xml.h */,
+                               ECE352C2175C42AB00FC07CB /* garmin_fs.h */,
+                               ECE352C3175C42AB00FC07CB /* garmin_gpi.h */,
+                               ECE352C4175C42AB00FC07CB /* garmin_tables.h */,
+                               ECE352C5175C42AB00FC07CB /* gbdatetime.h */,
+                               ECE352C6175C42AB00FC07CB /* gbfile.h */,
+                               ECE352C7175C42AB00FC07CB /* gbser_private.h */,
+                               ECE352C8175C42AB00FC07CB /* gbser.h */,
+                               ECE352C9175C42AB00FC07CB /* gbtypes.h */,
+                               ECE352CA175C42AB00FC07CB /* grtcirc.h */,
+                               ECE352CB175C42AB00FC07CB /* height.h */,
+                               ECE352CC175C42AB00FC07CB /* holux.h */,
+                               ECE352CD175C42AB00FC07CB /* inifile.h */,
+                               ECE352CE175C42AB00FC07CB /* magellan.h */,
+                               ECE352CF175C42AB00FC07CB /* mapsend.h */,
+                               ECE352D0175C42AB00FC07CB /* navilink.h */,
+                               ECE352D1175C42AB00FC07CB /* pdbfile.h */,
+                               ECE352D2175C42AB00FC07CB /* queue.h */,
+                               ECE352D3175C42AB00FC07CB /* quovadis.h */,
+                               ECE352D4175C42AB00FC07CB /* session.h */,
+                               ECE352D5175C42AB00FC07CB /* strptime.h */,
+                               ECE352D6175C42AB00FC07CB /* uuid.h */,
+                               ECE352D7175C42AB00FC07CB /* xmlgeneric.h */,
                                FB61758D0F0FDA4BA867C3D5 /* Sources */,
                                7CABE3C80E79AD2B307756D2 /* Sources [qmake] */,
                                ED1E82605DD74B483AF3C982 /* External Frameworks and Libraries */,
index b91f0cc265abac4b5aefffe4056f37f0d0fc78b9..ca4bc1663d56f454e0912ad9b1c75b6a87657f57 100644 (file)
Binary files a/gpsbabel/GPSBabel.xcodeproj/project.xcworkspace/xcuserdata/robertlipe.xcuserdatad/UserInterfaceState.xcuserstate and b/gpsbabel/GPSBabel.xcodeproj/project.xcworkspace/xcuserdata/robertlipe.xcuserdatad/UserInterfaceState.xcuserstate differ
index ff6311e81bd05eef08d5946a50801f9c3eded891..4af5ba618a0d1c9ff075b7eda126f93642b6a4a9 100644 (file)
@@ -36,7 +36,7 @@
 /* macros */
 #define LAT_DIR(a) a < 0.0 ? 'S' : 'N'
 #define LON_DIR(a) a < 0.0 ? 'W' : 'E'
-#define NONULL(a) a ? a : ""
+#define NONULL(a) a.isNull() ? "" : a.toAscii().data()
 #define ISWHITESPACE(a) ((a == ' ') || (a == '\t'))
 
 /* convert excel time (days since 1900) to time_t and back again */
@@ -2038,12 +2038,14 @@ xcsv_waypt_pr(const waypoint* wpt)
       break;
     case XT_TRACK_NAME:
       if (csv_track) {
-        writebuff(buff, fmp->printfc, NONULL(csv_track->rte_name));
+        QString r = csv_track->rte_name;
+        writebuff(buff, fmp->printfc, NONULL(r));
       }
       break;
     case XT_ROUTE_NAME:
       if (csv_route) {
-        writebuff(buff, fmp->printfc, NONULL(csv_route->rte_name));
+        QString r = csv_route->rte_name;
+        writebuff(buff, fmp->printfc, NONULL(r));
       }
       break;
 
index 6df08b2eb9e48e59ac3d7758263565fb156fdbca..46b14b7325a9722eda85e461fb432b331c93e0e9 100644 (file)
@@ -143,6 +143,15 @@ fwrite_string(gbfile* fd, const char* str)
     fwrite_integer(fd, 0);
   }
 }
+static void
+fwrite_string(gbfile* fd, QString& str) {
+  if (str.isEmpty()) {
+    fwrite_integer(fd, 0);
+  } else {
+    fwrite_integer(fd, str.length());
+    gbfwrite(str.toAscii().data(), 1, str.length(), fd);
+  }
+}
 
 void
 fwrite_fixedstring(gbfile* fd, const char* str, int fieldlen)
index 6bfb41fb79b09a717e4c2628f608d1231af28881..31d18d7d924401e34e7089fe5e59841d41431e7c 100644 (file)
@@ -353,18 +353,17 @@ mapsend_waypt_pr(const waypoint* waypointp)
 static void
 mapsend_route_hdr(const route_head* rte)
 {
-  char* rname;
+  QString rname;
+  QString r = rte->rte_name;
 
   /* route name -- mapsend really seems to want something here.. */
-  if (!rte->rte_name) {
+  if (r.isEmpty()) {
     rname = xstrdup("Route");
   } else {
-    rname = xstrdup(rte->rte_name);
+    rname = rte->rte_name;
   }
   gbfputpstr(rname, mapsend_file_out);
 
-  xfree(rname);
-
   /* route # */
   gbfputint32(rte->rte_num, mapsend_file_out);
 
index 3dd5ac2eba6b4769560d863b85c1f2262b30f88f..ed119acb88ef52094e5e988312932a19a1b19a57 100644 (file)
@@ -504,7 +504,6 @@ psit_routehdr_w(gbfile *psit_file, const route_head *rte)
     } else {
       rname = xstrdup(rte->rte_name);
     }
-
     /* check for psitrex comment sign; replace with '$' */
     while ((c = strchr(rname, '#'))) {
       *c = '$';